<?php
if(!floatval($cost))
{
    $_POST['error']['cost'] = TRUE;
}
elseif (floatval($cost) <=0)
{
    $_POST['error']['cost'] = TRUE;
}
else
{
    $cost = floatval($cost);
}
?>